//
//  UIFont+FontSizeChange.m
//  YJB
//
//  Created by YJB on 2017/3/14.
//  Copyright © 2017年 YJB. All rights reserved.
//

@implementation UILabel (FontSizeChange)
+ (void)load
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        SEL systemSetFont = @selector(setFont:);
        SEL swizzSetFont = @selector(swizzsetFont:);
        
        Method systemSetFontMethod = class_getInstanceMethod([self class], systemSetFont);
        Method swizzSetFontSizeMethod = class_getInstanceMethod([self class], swizzSetFont);
        //交换两个方法的实现
        method_exchangeImplementations(systemSetFontMethod, swizzSetFontSizeMethod);
    });
}

- (void)swizzsetFont:(UIFont *)font
{
    //label的tag值大于或等于100才做字体大小修改
//    if (self.tag <= 100)
//    {
////        NSInteger fontType = [[YJAppDataManager sharedManager].appFontSizeType integerValue];
////        CGFloat fontSizeScale = fontType == 0?1:fontType == 1?chatFontsizeMidScale:chatFontsizeLargeScale;
//        CGFloat fontSize = font.pointSize;
//        font = [UIFont systemFontOfSize:fontSize * 1.25];
//    }
    [self swizzsetFont:font];
}



@end
